-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(jellyfish-api-core): Add updatemasternode RPC typings #1847
Conversation
✅ Deploy Preview for jellyfishsdk ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Code Climate has analyzed commit 399b613 and detected 0 issues on this pull request. View more on Code Climate. |
✅ Deploy Preview for jellyfishsdk ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Codecov ReportBase: 90.81% // Head: 92.12% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1847 +/- ##
==========================================
+ Coverage 90.81% 92.12% +1.31%
==========================================
Files 357 361 +4
Lines 10430 10477 +47
Branches 1316 1320 +4
==========================================
+ Hits 9472 9652 +180
+ Misses 912 786 -126
+ Partials 46 39 -7
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Docker build preview for jellyfish/apps is ready! Built with commit 428f618
You can also get an immutable image with the commit hash
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
packages/jellyfish-api-core/__tests__/category/masternode/updatemasternode.test.ts
Outdated
Show resolved
Hide resolved
I have referred to
|
This test requires manually building an incorrect transaction, I think it is better suited for the tests on #1863
Fixed in ca6ca20, but we should refactor the tests in the PR to use the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, with 1 minor change for clarity
packages/jellyfish-api-core/__tests__/category/masternode/updatemasternode.test.ts
Outdated
Show resolved
Hide resolved
packages/jellyfish-api-core/__tests__/category/masternode/updatemasternode.test.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
State is fully deterministic.
packages/jellyfish-api-core/__tests__/category/masternode/updatemasternode.test.ts
Outdated
Show resolved
Hide resolved
packages/jellyfish-api-core/__tests__/category/masternode/updatemasternode.test.ts
Outdated
Show resolved
Hide resolved
packages/jellyfish-api-core/__tests__/category/masternode/updatemasternode.test.ts
Outdated
Show resolved
Hide resolved
packages/jellyfish-api-core/__tests__/category/masternode/updatemasternode.test.ts
Outdated
Show resolved
Hide resolved
packages/jellyfish-api-core/__tests__/category/masternode/updatemasternode.test.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, with a few suggestions that we don't have to apply now. More than 2000 test cases, I believe, are written in the "old style" that has been discouraged now.
|
||
it('should updateMasternode with utxos', async () => { | ||
const balance = await container.call('getbalance') | ||
expect(balance >= 2).toBeTruthy() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kinda weird to write it like this, it should be
expect(balance >= 2).toBeTruthy() | |
expect(balance).toBeGreaterThanOrEqual(2) |
expect(masternodes[masternodeId]).toBeTruthy() | ||
expect(masternodes[masternodeId].state).toStrictEqual('TRANSFERRING') | ||
expect(masternodes[masternodeId].ownerAuthAddress).toStrictEqual(initialAddress) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expect(masternodes[masternodeId]).toBeTruthy() | |
expect(masternodes[masternodeId].state).toStrictEqual('TRANSFERRING') | |
expect(masternodes[masternodeId].ownerAuthAddress).toStrictEqual(initialAddress) | |
expect(data).toStrictEqual(expect.objectContaining({ | |
state: 'TRANSFERRING', | |
ownerAuthAddress: initialAddress | |
})) |
For better readability, it's better to write tests like this. Most of the tests written previously were written the previous "style" that we've since discouraged. We don't have to change it now but just a thought for the future.
What this PR does / why we need it:
Which issue(s) does this PR fixes?:
Fixes part of #1842